<!doctype html>
<html xmlns:th="http://www.thymeleaf.org" xmlns:yh="http://www.thymeleaf.org">
<head th:replace="themes/yqq/header::resources(${original_title},${article.tags})"></head>
<style>

em {
    color: red;
    font-style: normal;
    font-weight: bold;
}

</style>
<body>
<!--top begin-->
<div th:replace="themes/yqq/header::top"></div>
<!--top end-->
<article id="article"> 
  <!--lbox begin-->
  <div class="lbox">
    <div class="content_box whitebg">
    	<input type="hidden" id="cid" th:value="${article.cid}"/>
      <h2 class="htitle"><span class="con_nav">您现在的位置是：<a th:href="@{/}">网站首页</a>><a th:href="@{'/list?category='+${commons.urlEncode(article.categories)}}" th:text="${article.categories}">个人博客模板</a></span>  <div th:text="${article.categories}">个人博客模板</div> </h2>
      <h1 class="con_tilte" th:utext="${article.title}"></h1>
      <p class="bloginfo"><i class="avatar"><img th:src="@{/yqq/images/avatar.jpg}"></i><span th:text="${siteInfo.site_nickname}">张念祥</span><span th:text="${commons.fmtdate(article.created, 'yyyy-MM-dd')}">2018-10-28</span><span>【<d th:if="${#lists.isEmpty(articleTags)}"><span>无标签</span></d><d th:each="tag,stat:${articleTags}"><a th:href="@{'/list?tag='+${commons.urlEncode(tag)}}" th:text="${tag}"></a><d th:text="${stat.count!=#lists.size(articleTags)?',':''}"></d></d>】</span><span><d th:text="${article.hits}"></d>人已围观</span> 
      	<span style="float:right;"><a th:if="${session.login_user!=null && session.login_user.username=='admin'}" target="_BLANK" th:href="@{'/admin/article/'+${article.cid}}" style="color: #096;">编辑</a>&nbsp;&nbsp;&nbsp;<a href="#" onclick="shouCang()" style="color: #096;">点击收藏</a></span>
      </p>
      <p class="con_info"><b>简介</b><d th:utext="${article.remark}"></d></p>
      <div class="con_text">
      	<div class='ueparse'><p th:utext="${article.content}"></p></div>
        <p class="share"><b>转载：</b><span th:utext="${siteInfo.site_reprinted}"></span></p>
<!--         <p><span class="diggit">很赞哦！ (74)</span></p> -->
        <div class="nextinfo">
          <p th:if="${pre!=null}">上一篇：<a th:href="@{'/article/'+${pre.cid}}" th:text="${pre.title}">html5 个人博客模板《蓝色畅想》</a></p>
          <p th:if="${next!=null}">下一篇：<a th:href="@{'/article/'+${next.cid}}" th:text="${next.title}">个人博客模板《tree》-响应式个人网站模板</a></p>
        </div>
      </div>
    </div>

    <div class="whitebg gbook">
      <h2 class="htitle">文章评论</h2>
      <div th:if="${session.login_user!=null}">
      	
      <hr>
      	<div th:each="comment:${comments}" style="padding-bottom: 15px">
      		<p class="share">
      			<b th:text="${comment.author+'：'}"></b> <span th:text="${comment.content}"></span>
      			<br/>
      			<t style="text-align:right" th:text="${commons.fmtdate(comment.created, 'yyyy-MM-dd HH:mm:ss')}"></t>
      		</p>
      	</div>
      <form id="addComment" onsubmit="return checkForm()" th:if="${article.allowComment}">
      	<input name="cid" type="hidden" th:value="${article.cid}">
      	<textarea name="text" rows="5" cols="" style="width: 100%" required="required"></textarea>
      	<input type="submit" value="提交评论">
      </form>
      
      </div>
      <div th:if="${session.login_user==null}"><a th:href="@{/login}">未登录</a></div>
      <ul>
      </ul>
    </div>
  </div>
  <!--lbox end-->
  <div class="rbox">
    <div class="whitebg paihang" id="readTop">
    	<h2 class="htitle">点击排行</h2>
      <section class="topnews imgscale" th:if="${topRead1!=null}"><a th:href="@{'/article/'+${topRead1.cid}}"><img th:src="@{${topRead1.cover==null or topRead1.cover==''}?'/yqq/images/h1.jpg':${topRead1.cover}}"><span th:text="${topRead1.title}"></span></a></section>
      <ul>
        <li th:each="t:${topRead}"><i></i><a th:href="@{'/article/'+${t.cid}}" th:text="${t.title}"></a></li>
      </ul>
    </div>
    <div class="whitebg tuijian">
      <h2 class="htitle">本栏推荐</h2>
      <section class="topnews imgscale" th:if="${categoryPutTop1!=null}">
      	<a th:href="@{'/article/'+${categoryPutTop1.cid}}"><img th:src="@{${categoryPutTop1.cover==null or categoryPutTop1.cover==''}?'/yqq/images/h2.jpg':${categoryPutTop1.cover}}"><span th:text="${categoryPutTop1.title}">6条网页设计配色原则,让你秒变配色高手</span></a></section>
      <ul>
        <li th:each="c,stat:${categoryPutTop}"><a th:href="@{'/article/'+${c.cid}}"><i><img th:src="@{'/yqq/images/text0'+${stat.count}+'.jpg'}"></i>
          <p th:text="${c.title}">十条设计原则教你学会如何设计网页布局!</p>
          </a></li>
      </ul>
    </div>
<!--     <div class="ad whitebg imgscale"> -->
<!--       <ul> -->
<!--         <a href="/"><img src="images/ad.jpg"></a> -->
<!--       </ul> -->
<!--     </div> -->
    <div class="whitebg cloud">
      <h2 class="htitle">标签云</h2>
      <ul>
        <a th:href="@{'/list?tagId='+${t.mid}}" target="_blank" th:each="t:${allTags}" th:text="${t.name}+'('+${t.count}+')'">个人博客模板</a> 
      </ul>
    </div>
    <div class="whitebg wenzi">
      <h2 class="htitle">猜你喜欢</h2>
      <ul>
        <li th:each="r:${rand}"><a th:href="@{'/article/'+${r.cid}}" th:text="${r.title}"></a></li>
      </ul>
    </div>
    <div class="whitebg tongji">
      <h2 class="htitle">站点信息</h2>
      <ul>
        <li><b>建站时间</b>：<span th:text="${webInfo.options.site_time}"></span></li>
        <li><b>网站名称</b>：<span th:text="${webInfo.options.site_title}"></span></li>
        <li><b>文章统计</b>：<span th:text="${webInfo.articleSize}"></span>条</li>
        <li><b>文章评论</b>：<span th:text="${webInfo.commentSize}"></span>条</li>
        <li><b>博主昵称</b>：<span th:text="${webInfo.options.site_nickname}"></span></li>
        <li><b>博主微博</b>：<a th:href="@{${webInfo.options.social_weibo}}" th:text="${webInfo.options.social_weibo}"></a></li>
      </ul>
    </div>
  </div>
</article>

<div th:replace="themes/yqq/header::footer"></div>

<script th:src="@{/admin/plugins/ueditor/ueditor.parse.js}" ></script>

<script th:inline="javascript">
	$(function(){
		uParse('.ueparse', {
			rootPath : ctxPath+"admin/plugins/ueditor/"
		});
		
		
// 		setTimeout(function(){ 
// 			var article = $("#article").html();

// 			var reg1 = new RegExp("this_is_highlight_pre_tag","g");
// 			article = article.replace(reg1,"<em>");
			
// 			var reg2 = new RegExp("this_is_highlight_post_tag","g");
// 			article = article.replace(reg2,"</em>");
// 			$("#article").html(article);
// 		}, 50);
	});
	var tale = new $.tale();
	function checkForm() {
        tale.post({
            url: ctxPath+'comment',
            data: $("#addComment").serialize(),
            success: function (result) {
                if (result && result.success) {
                	tale.alertOk({
                        text:'评论成功',
                        then: function () {
                            setTimeout(function () {
                                window.location.reload();
                            }, 500);
                        }
                    });
                } else {
                    tale.alertError(result.msg || '登录失败');
                }
            }
        });
        return false;
    }
	
	function shouCang() {
        tale.post({
            url: ctxPath+'follow',
            data: {
            	cid:$("#cid").val()
            },
            success: function (result) {
                if (result && result.success) {
                	tale.alertOk({
                        text:result.msg||'收藏成功',
                        then: function () {
                            setTimeout(function () {
                                window.location.reload();
                            }, 500);
                        }
                    });
                } else {
                    tale.alertError(result.msg || '收藏失败');
                }
            }
        });
        return false;
    }
	
</script>
<div th:replace="themes/yqq/header::trans"></div>
</body>
</html>
